﻿Public Structure AutoIncreaseNumber
    Implements IEquatable(Of AutoIncreaseNumber)

    Public Sub New(ByVal start As Integer, ByVal factor As Integer)
        If _value < start Then
            _value = start
        Else
            _value += factor
        End If
    End Sub

    Public dummy As Object

    Public Shared _value As Integer = 0
    Public ReadOnly Property Value() As Integer
        Get
            Return _value
        End Get
    End Property

    Public Overloads Function Equals(ByVal other As AutoIncreaseNumber) As Boolean _
        Implements IEquatable(Of AutoIncreaseNumber).Equals
        Return Me.Value = other.Value
    End Function

    Public Shared Operator =(ByVal left As AutoIncreaseNumber, ByVal right As AutoIncreaseNumber) As Boolean
        Return (left.Equals(right))
    End Operator

    Public Shared Operator <>(ByVal left As AutoIncreaseNumber, ByVal right As AutoIncreaseNumber) As Boolean
        Return (Not left.Equals(right))
    End Operator

End Structure
